
#ifndef DictionaryEntry_h
#define DictionaryEntry_h

// Riccsson includes.
#include <Typedef.h>
#include <Defines.h>
#include <CSharpPropertyMethods.h>

#include <System/Object.h>
#include <System/ArgumentNullException.h>

namespace Riccsson
{
	namespace System
	{
		namespace Collections
		{
			// Summary:
			//     Defines a dictionary key/value pair that can be set or retrieved.
			struct DictionaryEntry
			{
				GC_PTR<object> _Key;
				GC_PTR<object> _Value;

				PROP3GET(DictionaryEntry, GC_PTR<object>, Key)
				PROP3GET(DictionaryEntry, GC_PTR<object>, Value)
				
				COPY_CONSTRUCTOR(DictionaryEntry)
				{
					PROP3GET_INIT_COPY(DictionaryEntry, GC_PTR<object>, Key);
					PROP3GET_INIT_COPY(DictionaryEntry, GC_PTR<object>, Value);

					_Key = other._Key;
					_Value = other._Value;
				}

				public: DictionaryEntry()
					: PROP3GET_INIT(DictionaryEntry, Key)
					, PROP3GET_INIT(DictionaryEntry, Value)
				{
				}

				//
				// Summary:
				//     Initializes an instance of the System.Collections.DictionaryEntry type with
				//     the specified key and value.
				//
				// Parameters:
				//   key:
				//     The object defined in each key/value pair.
				//
				//   value:
				//     The definition associated with key.
				//
				// Exceptions:
				//   System.ArgumentNullException:
				//     key is null and the .NET Framework version is 1.0 or 1.1.
				public: DictionaryEntry(object* key, object* value)
					: PROP3GET_INIT(DictionaryEntry, Key)
					, PROP3GET_INIT(DictionaryEntry, Value)
				{
					if(Key.get() == null)
					{
						throw ArgumentNullException("Key can not be null.");
					}

					_Key = Key;
					_Value = Value;
				}

				// Summary:
				//     Gets or sets the key in the key/value pair.
				//
				// Returns:
				//     The key in the key/value pair.
				public: PROP3_GET(GC_PTR<object>, Key)
				{
					return _Key;
				}

				//
				// Summary:
				//     Gets or sets the value in the key/value pair.
				//
				// Returns:
				//     The value in the key/value pair.
				public: PROP3_GET(GC_PTR<object>, Value)
				{
					return _Value;
				}
				public: PROP3_SET(GC_PTR<object>, Value)
				{
					_Value = value;
				}
			};
		}
	}
}

#endif